class ShowReshipsController < ApplicationController
  layout "base.html"

  def show
    @reship = Reship.find params[:id]
    @last_reship = Reship.first :conditions => ["created_at < ?", @reship.created_at], :order => "created_at desc"
    @next_reship = Reship.first :conditions => ["created_at > ?", @reship.created_at], :order => "created_at"
    @html_title = @reship.author.nick_name + '的日志' + "-" + @reship.title
    @html_description = @reship.author.nick_name + '的日志' + "-" + @reship.title
    #初始化日志浏览的评论
    @post = Post.new :reship_id => @reship.id,
      :created_by_valleyer_id => current_valleyer_id
    respond_to do |format|
      format.html do
        @valleyer = @reship.author
      end
      format.js do
        render :layout => false
      end
    end
    #浏览reship记录
    @browse_record = BrowseRecord.create(
      :reship_id => @reship.id,
      :browser_id => current_valleyer_id
    )
  end

  def authorize

  end
end
